<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" lazy-render>
    <van-swipe-item v-for="(item, index) in swiperList" :key="index">
      <img :src="item.imgSrc" alt="" />
    </van-swipe-item>
  </van-swipe>
</template>

<script lang='ts' setup>
import { ref } from 'vue';
import { getSwiperRequest } from '@/network/home';
import { InterfaceSwiperList } from './home';

const swiperList = ref<InterfaceSwiperList[]>([])

const getSwiperList = () => {
  getSwiperRequest().then((res: any) => swiperList.value = res.result)
}
getSwiperList()
</script>

<style scoped>
.van-swipe-item img {
  width: 100%;
}
</style>